package com.iflytek.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.UUID;


public class AutoCreateIdUtils {

	// 生成uuid方法
	public static String getUUID() {
		return UUID.randomUUID().toString();
	}


	public static  String getOID() {
		SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
		Date date=new Date();
		String nowtime = df.format(date);
		Random rand = new Random();
		String code = "";
		for (int i = 0; i < 6; i++) {
			code += rand.nextInt(10);
		}
		String oid=nowtime+code;
	    return oid;
	}

}
